package com.itheima.controller;

import com.itheima.Service.UserLoginService;
import com.itheima.pojo.LoginDto;
import com.itheima.pojo.LoginInfo;
import com.itheima.pojo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user/userlogin")
public class UserLoginController {

    @Autowired
    private UserLoginService userLoginService;

    @PostMapping
    public Result userLogin(@RequestBody LoginDto dto) {
      LoginInfo loginInfo =userLoginService.login(dto);

        return Result.success(loginInfo);
    }
}
